//
//  CTLoginLogic.h
//  ConstellationTalk_0.1
//
//  Created by riley on 15/4/22.
//  Copyright (c) 2015年 riley chu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CTLoginItems.h"

typedef enum {
    CTTpLoginTypeWeiBo = 1,
    CTTpLoginTypeQQ,
    CTTpLoginTypeWechat
}CTTpLoginType;


typedef void (^requestSuccessBlock) ();
typedef void (^requestFailedBlock) ();



@protocol CTLoginLogicDelegate;


@interface CTLoginLogic : NSObject


@property(nonatomic,assign)id<CTLoginLogicDelegate>delegate;

-(void)mobileLoginRequest:(CTMobileLoginRequestItem *)item
 successCompletionHandler:(requestSuccessBlock)successBlock
            failedHandler:(requestFailedBlock)failedBlock;

//第三方登录
-(void)tpLoginRequestWithLoginType:(CTTpLoginType)type;

-(BOOL)isPasswordEnable:(NSString *)pass;

@end





@protocol CTLoginLogicDelegate <NSObject>

-(void)isPassWordEnable:(BOOL)flag description:(NSString *)descri;

//认证
-(void)authorFailed:(CTLoginLogic *)logic;

//登录回调
-(void)tpLoginSuccessed:(CTLoginLogic *)logic;
-(void)tpLoginFailed:(CTLoginLogic *)logic withError:(NSError *)err;

@end



